package com.study.zookeeper;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class MySocketServer {
    public static void main(String[] args) throws Exception {
//        Socket s = new Socket("127.0.0.1", 2881);
        ServerSocket s = new ServerSocket(2881);
        Socket socket = s.accept();
        byte[] bytes = new byte[1024];
        socket.getInputStream().read(bytes);

        String s1 = new String(bytes);
        System.out.println(s1);
    }
}
